<template>
    <div class="child">
        <h3>孙子组件:孙子</h3>
        <p>爷爷给我零花钱：{{ money }}</p>
        <button @click="updateMoney(10)">花费10块</button>
    </div>
</template>

<script setup lang="ts" name="Child">
import { inject } from 'vue';


let {money,updateMoney} = inject('money',{
    
    money : 0,
    updateMoney:function updateMoney(params:number) {
        
    }
});


</script>

<style scoped>
.child {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    background-color: #f0f0f0;
}
</style>
